package com.keqiongzc.module_login.service

import android.content.Context
import androidx.lifecycle.LiveData
import com.alibaba.android.arouter.facade.annotation.Route
import com.everyline.lib_common.bean.UserInfoBean
import com.everyline.lib_common.router.RouterPath
import com.everyline.lib_common.service.LoginService
import com.keqiongzc.module_login.UserManager

/**
 * Created by on 2021/2/27.
 * 天天挂线
 *  746608431@qq.com
 *  描述:TODO
 */

@Route(path = RouterPath.Login.PATH_LOGIN2)
class LoginServiceImpl : LoginService {
    override fun isLogin(): Boolean {
        return UserManager.isLogin()
    }

    override fun getUserInfo(): UserInfoBean? {
        return UserManager.getUser()
    }

    override fun removeUserInfo() {
        UserManager.removeUser()

    }

    override fun start(context: Context): LiveData<UserInfoBean> {
        return UserManager.start(context)
    }

    override fun getLiveData(): LiveData<UserInfoBean> {
        return UserManager.getLoginLiveData()

    }
}